package cn.thoughtworks.school.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;


@FeignClient(name = "${feign.userCenter.name}",
    url = "${feign.userCenter.url}")
@Service
public interface UserCenterFeign {

  @GetMapping("/api/users/{userId}")
  Map getUser(@PathVariable("userId") Long userId);

  @PutMapping("/api/users/{userId}/detail")
  void modifyUserDetail(@PathVariable("userId") Long userId, @RequestBody Map updateUserDetail);

}
